package com.liurui.demo.serviceImpl;

import com.liurui.demo.mapper.EmployeeMapper;
import com.liurui.demo.pojo.Employee;
import com.liurui.demo.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;
    @Override
    public Collection<Employee> getEmployees() {
        return employeeMapper.getEmployees();
    }

    @Override
    public void insert(Employee employee) {
        employeeMapper.insert(employee);
    }

    @Override
    public Employee getEmployeeById(Integer id) {
        return employeeMapper.getEmployeeById(id);
    }

    @Override
    public void deleteEmployeeById(Integer id) {
        employeeMapper.deleteEmployeeById(id);
    }

    @Override
    public void update(Employee employee) {
        employeeMapper.update(employee);
    }
}
